package com.lz.redis.project.controller;


import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.StopWatch;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson2.JSON;
import com.lz.redis.common.domain.ResponseVo;
import com.lz.redis.common.redis.*;
import com.lz.redis.common.redis.queue.RedisPublisher;
import com.lz.redis.common.utils.DateUtils;
import com.lz.redis.project.entity.RedisMonitor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 *
 */
@RestController
@RequestMapping(value = "/redisQueue")
public class RedisQueueController {

    @Resource
    private RedisPublisher redisPublisher;

    @PostConstruct
    public void init() {
        send();
    }

    @PostMapping("/publish")
    public ResponseVo send() {
        redisPublisher.publish("橡皮人","生产者测试消息,时间："+ DateUtils.getCurr_YYYY_MM_DD_HH_MM_SS_SSS());
        return ResponseVo.success();
    }


}